<template>
  <div class="q-pa-md">
    <div class="q-gutter-y-md column" style="max-width: 300px">
      <t-field filled :model-value="email" suffix="@gmail.com" label-slot>
        <template v-slot:label>
          <div class="row items-center all-pointer-events">
            <t-icon
              class="q-mr-xs"
              color="deep-orange"
              size="24px"
              name="mail"
            />
            Email (hover for more info)

            <t-tooltip
              class="bg-grey-8"
              anchor="top left"
              self="bottom left"
              :offset="[0, 8]"
              >Email address</t-tooltip
            >
          </div>
        </template>

        <template v-slot:control>
          <div
            class="self-center full-width no-outline text-right"
            tabindex="0"
            >{{ email }}</div
          >
        </template>
      </t-field>

      <t-field outlined :model-value="number" prefix="$" label-slot>
        <template v-slot:control>
          <div class="self-center full-width no-outline" tabindex="0">{{
            number
          }}</div>
        </template>

        <template v-slot:append>
          <t-avatar>
            <img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg" />
          </t-avatar>
        </template>

        <template v-slot:label>
          <span class="text-weight-bold text-deep-orange">You</span>
          can customize the
          <span
            class="q-px-sm bg-deep-orange text-white text-italic rounded-borders"
            >label</span
          >
        </template>
      </t-field>
    </div>
  </div>
</template>

<script>
  import { ref } from 'vue';

  export default {
    setup() {
      return {
        email: ref('john.doe'),
        number: ref(123),
      };
    },
  };
</script>
